package com.braveman.im.thread;

import android.os.Handler;
import android.os.Message;
import android.os.SystemClock;

public class ValidateThread extends Thread {
    public static final int TIME = 60;

    private Handler mHandler;
    private int time;

    public ValidateThread(Handler handler) {
        this.mHandler = handler;
    }


    @Override
    public void run() {
        while (time <= TIME){
            Message msg = Message.obtain();
            msg.what = 100;
            SystemClock.sleep(1000);
            time++;
            msg.obj = (TIME-time)+"s";
            mHandler.sendMessage(msg);
        }
        mHandler.sendEmptyMessage(200);
    }

}